package com.cea.papyrustest.uml.createcommand;

import org.eclipse.uml2.uml.Association;
import org.eclipse.uml2.uml.Element;

import com.cea.papyrus.core.commands.UMLElementCreateCommand;
import com.cea.papyrus.core.pseudoelement.GraphicalLink;

/**
 * Test class for {@link Association} creation command
 * @author Patrick Tessier
 */
public class CommentLinkCreateCommandTest extends PapyrusCommandTest{


	public static String NAME="CommentLink0";
	/**
	 * Default constructor
	 * @param name the name oif the test case
	 */
	public CommentLinkCreateCommandTest(String name) {
		super(name);	
	}

	@Override
	protected void setUp() throws Exception {
		super.setUp();
		papyrusCommand= new UMLElementCreateCommand(GraphicalLink.class,model);
	}

	/* (non-Javadoc)
	 * @see com.cea.papyrustest.PapyrusCommandTest#testExecute()
	 */
	@Override
	public void testExecute() {
		stack.execute(papyrusCommand);
		Element clazz=model.getPackagedElement(NAME);
		assertTrue("this command is executable",papyrusCommand.canExecute());
		assertTrue("this command is undoable",papyrusCommand.canUndo());
		
	}
}
